package com.share.cloudStorage.utils;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.share.cloudStorage.model.Result;

import java.io.IOException;
import javax.servlet.http.HttpServletResponse;



public class UtilFilter {
    private static ObjectMapper objectMapper = new ObjectMapper();
    public static void  writeResult(HttpServletResponse response, Result result) throws IOException {
        response.setStatus(401);
        response.setContentType("application/json");
        response.getWriter().write(objectMapper.writeValueAsString(result));
    }
}
